<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>主页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <style type="text/css">
        .main {
            text-align: center;
            margin: 200px 0;
        }
    </style>
</head>
<body>

<div class="main">
    <a href="javascript:exportUser2();">
        导出2
    </a>
    <a href="javascript:isValid()">
        检验日期格式
    </a>
</div>

<script th:src="@{/utils/common.util.js}"></script>
<script th:src="@{/jquery-min-3.4.1.js}"></script>
<script type="text/javascript">
    function exportUser2() {
        window.location.href = "/role/export/excel?reportPageType=SEARCH_PAGE_TYPE_FEED_LAUNCH_REPORT";
    }

    function isValid() {
        var user = {
            "username": "aitao",
            "paaswod": "123456",
            "age": 14,
            "date": "2017-04-21"
        }
        var userStr = JSON.stringify(user);
        console.log(userStr)
        $.ajax({
            url: "/role/test/valid",
            type: "post",
            contentType: "application/json",
            data: userStr,
            success: function (res) {
                console.log(res)
            }
        });
    }
</script>
</body>
</html>